.class public Lcom/estrongs/android/pop/app/filetransfer/p;
.super Ljava/lang/Object;
.source "WifiScanUtil.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/app/filetransfer/p$d;,
        Lcom/estrongs/android/pop/app/filetransfer/p$b;,
        Lcom/estrongs/android/pop/app/filetransfer/p$c;
    }
.end annotation


# instance fields
.field private volatile a:Ljava/net/MulticastSocket;

.field private b:Ljava/lang/String;

.field private volatile c:Ljava/net/InetAddress;

.field private d:Lcom/estrongs/android/pop/app/filetransfer/p$c;

.field private e:Lcom/estrongs/android/pop/app/filetransfer/p$b;

.field private f:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Les/ol;",
            ">;"
        }
    .end annotation
.end field

.field private g:Lcom/estrongs/android/pop/app/filetransfer/p$d;

.field private h:Ljava/lang/Thread;

.field private i:Z


# direct methods
.method public constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->d:Lcom/estrongs/android/pop/app/filetransfer/p$c;

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->e:Lcom/estrongs/android/pop/app/filetransfer/p$b;

    .line 4
    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    iput-object v1, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->f:Ljava/util/Map;

    .line 5
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->h:Ljava/lang/Thread;

    const/4 v0, 0x0

    .line 6
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->i:Z

    .line 7
    :try_start_0
    invoke-static {}, Lcom/estrongs/android/util/f0;->b()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->b:Ljava/lang/String;

    .line 8
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    const-string v1, "wifi"

    .line 9
    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/wifi/WifiManager;

    .line 10
    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getDhcpInfo()Landroid/net/DhcpInfo;

    .line 11
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/filetransfer/p;->e()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 12
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    :goto_0
    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/filetransfer/p;)Z
    .locals 0

    .line 1
    iget-boolean p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->i:Z

    return p0
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/filetransfer/p;)Ljava/lang/String;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->b:Ljava/lang/String;

    return-object p0
.end method

.method static synthetic c(Lcom/estrongs/android/pop/app/filetransfer/p;)Ljava/net/InetAddress;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    return-object p0
.end method

.method private c()V
    .locals 2

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    if-eqz v0, :cond_0

    .line 3
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    iget-object v1, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    invoke-virtual {v0, v1}, Ljava/net/MulticastSocket;->leaveGroup(Ljava/net/InetAddress;)V
    :try_end_0
    .catch Ljava/lang/Error; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    goto :goto_1

    :catch_0
    move-exception v0

    .line 4
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Error;->printStackTrace()V

    .line 5
    :goto_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    invoke-virtual {v0}, Ljava/net/MulticastSocket;->close()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_2

    .line 6
    :goto_1
    invoke-virtual {v0}, Ljava/lang/Throwable;->printStackTrace()V

    :goto_2
    const/4 v0, 0x0

    .line 7
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    .line 8
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    :cond_0
    return-void
.end method

.method static synthetic d(Lcom/estrongs/android/pop/app/filetransfer/p;)Ljava/net/MulticastSocket;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    return-object p0
.end method

.method private d()V
    .locals 1

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->i:Z

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->h:Ljava/lang/Thread;

    return-void
.end method

.method static synthetic e(Lcom/estrongs/android/pop/app/filetransfer/p;)Lcom/estrongs/android/pop/app/filetransfer/p$c;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->d:Lcom/estrongs/android/pop/app/filetransfer/p$c;

    return-object p0
.end method

.method private e()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    if-nez v0, :cond_0

    const-string v0, "224.0.0.1"

    .line 3
    invoke-static {v0}, Ljava/net/InetAddress;->getByName(Ljava/lang/String;)Ljava/net/InetAddress;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    .line 4
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    if-eqz v0, :cond_1

    .line 5
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/filetransfer/p;->c()V

    .line 6
    :cond_1
    new-instance v0, Ljava/net/MulticastSocket;

    const/16 v1, 0x18c7

    invoke-direct {v0, v1}, Ljava/net/MulticastSocket;-><init>(I)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    .line 7
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->a:Ljava/net/MulticastSocket;

    iget-object v1, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->c:Ljava/net/InetAddress;

    invoke-virtual {v0, v1}, Ljava/net/MulticastSocket;->joinGroup(Ljava/net/InetAddress;)V

    return-void
.end method

.method static synthetic f(Lcom/estrongs/android/pop/app/filetransfer/p;)Ljava/util/Map;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->f:Ljava/util/Map;

    return-object p0
.end method

.method static synthetic g(Lcom/estrongs/android/pop/app/filetransfer/p;)Lcom/estrongs/android/pop/app/filetransfer/p$d;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->g:Lcom/estrongs/android/pop/app/filetransfer/p$d;

    return-object p0
.end method

.method static synthetic h(Lcom/estrongs/android/pop/app/filetransfer/p;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/filetransfer/p;->d()V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 1

    const/4 v0, 0x0

    .line 14
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->d:Lcom/estrongs/android/pop/app/filetransfer/p$c;

    .line 15
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/filetransfer/p;->c()V

    return-void
.end method

.method public a(Lcom/estrongs/android/pop/app/filetransfer/p$d;)V
    .locals 0

    .line 13
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->g:Lcom/estrongs/android/pop/app/filetransfer/p$d;

    return-void
.end method

.method public a(Les/ol;)V
    .locals 5

    .line 6
    :try_start_0
    new-instance v0, Ljava/net/DatagramSocket;

    const/16 v1, 0x17eb

    invoke-direct {v0, v1}, Ljava/net/DatagramSocket;-><init>(I)V

    .line 7
    iget-object p1, p1, Les/ol;->d:Ljava/lang/String;

    .line 8
    invoke-static {p1}, Ljava/net/InetAddress;->getByName(Ljava/lang/String;)Ljava/net/InetAddress;

    move-result-object p1

    const-string v2, "OK"

    .line 9
    invoke-virtual {v2}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    .line 10
    new-instance v3, Ljava/net/DatagramPacket;

    array-length v4, v2

    invoke-direct {v3, v2, v4, p1, v1}, Ljava/net/DatagramPacket;-><init>([BILjava/net/InetAddress;I)V

    .line 11
    invoke-virtual {v0, v3}, Ljava/net/DatagramSocket;->send(Ljava/net/DatagramPacket;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    .line 12
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    :goto_0
    return-void
.end method

.method public a(Ljava/lang/String;)V
    .locals 1

    .line 2
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/p$b;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/filetransfer/p$b;-><init>(Lcom/estrongs/android/pop/app/filetransfer/p;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->e:Lcom/estrongs/android/pop/app/filetransfer/p$b;

    .line 3
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 4
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/p$a;

    invoke-direct {v0, p0, p1}, Lcom/estrongs/android/pop/app/filetransfer/p$a;-><init>(Lcom/estrongs/android/pop/app/filetransfer/p;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->h:Ljava/lang/Thread;

    .line 5
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method

.method public b()V
    .locals 1

    .line 2
    new-instance v0, Lcom/estrongs/android/pop/app/filetransfer/p$c;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/filetransfer/p$c;-><init>(Lcom/estrongs/android/pop/app/filetransfer/p;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/p;->d:Lcom/estrongs/android/pop/app/filetransfer/p$c;

    .line 3
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method
